/*

mincut.cpp ... the mincut object to be called

Copyright (C) 2009  Hon Wai, LAU <lau65536@gmail.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

*/

#ifndef IGRAPH_MINCUT_HPP
#define IGRAPH_MINCUT_HPP

#include <igraph/igraph.h>
#include <igraph/cpp/common.hpp>
#include <igraph/cpp/exception.hpp>
#include <igraph/cpp/vector.hpp>

namespace igraph {

	class Graph;

	class Mincut {
		const igraph_t* g;
		igraph_vector_t* partition1, *partition2, *cut;
		const igraph_vector_t* capacity;
		bool called;
				
	public:
		Mincut(const Graph& graph) throw();
		~Mincut();

		Mincut& get_partition1(Vector& first_partition) throw();
		Mincut& get_partition2(Vector& second_partition) throw();
		Mincut& get_cut(Vector& set_of_cut_edges) throw();
		Mincut& set_capacity(const Vector& edge_capacity) throw();

		Integer compute() MAY_THROW_EXCEPTION;
	};
}

#endif
